{include 'header.tpl'}
<ol class="breadcrumb">
    <li><a href="/goods/list">商品列表</a></li>
    <li><a href="/goods/categoryList">商品分类</a></li>
</ol>
<form method="get" action="/goods/list" class="form-inline">
    <table>
        <tr>
            <td>
                <label for="form-w" class="control-label">商品名称：</label>
                <input class="form-control" id="title" name="title" value="{$smarty.get.title}" placeholder="" size="6"/>
            </td>


          {*  <td>
                <label for="form-w" class="control-label">时间范围：</label>
                <input type="text" class="date-picker" id="begin_date" name="begin_date" value="{$smarty.get.begin_date}" style="width: 85px;"/> 至 <input type="text" class="date-picker" id="end_date" name="end_date" value="{$smarty.get.end_date}" style="width: 85px;"/>
            </td>*}
            <td>
                <label for="form-w" class="control-label">首页推荐：</label>
                <select name="is_banner" class="form-control" title="分类">
                    <option value="">--请选择是否首页推荐--</option>
                    <option value="1" {if $smarty.get.is_banner eq 1}selected="selected"{/if}>是</option>
                    <option value="2" {if $smarty.get.is_banner eq 2}selected="selected"{/if}>否</option>
                </select>
            </td>

            <td>
                <label for="form-w" class="control-label">分类：</label>
                <select name="goodsection" class="form-control" title="分类">
                    <option value="">--请选择分类--</option>
                    {foreach $goodsectionList as $key => $value}
                        <option value="{$value['id']}" {if $smarty.get.goodsection eq $value['id']}selected="selected"{/if}>{$value['name']}</option>
                    {/foreach}
                </select>
            </td>


            <td>
                <label for="form-w" class="control-label">是否售罄：</label>
                <select name="is_soldout" class="form-control" title="分类">
                    <option value="">--请选择是否售罄--</option>
                    <option value="1" {if $smarty.get.is_soldout eq 1}selected="selected"{/if}>是</option>
                    <option value="2" {if $smarty.get.is_soldout eq 2}selected="selected"{/if}>否</option>
                </select>
            </td>

            <td>
                <label for="form-w" class="control-label">状态：</label>
                <select name="status" class="form-control" title="分类">
                    <option value="">--请选择商品状态--</option>
                    <option value="1" {if $smarty.get.status eq 1}selected="selected"{/if}>正常</option>
                    <option value="2" {if $smarty.get.status eq 3}selected="selected"{/if}>下架</option>
                    <option value="-1" {if $smarty.get.status eq 2}selected="selected"{/if}>删除</option>
                </select>
            </td>

            <td>
                <button type="submit" class="btn btn-primary">查找</button>
                <a href="/adminmall/Goods/list" class="btn btn-danger">清空条件</a>
                <a href="/adminmall/Goods/add" class="btn btn-danger" >添加商品</a>
                {*<button type="button" onclick="dao()" class="btn btn-primary">导出</button>*}
            </td>
        </tr>
    </table>
</form>
<div class="clearfix" style="height:30px;"></div>
<table class="table" style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word">
    <tr>
        <td>ID</td>
        <td>商品名称</td>
        <td>分类</td>
        <td>详情图片</td>
        <td>首页推荐图片</td>
        <td>销售价格</td>
        <td>成本价格</td>
        <td>邮费</td>
        <td>出售数量</td>
        <td>购买人数</td>
        <td>是否首页推荐</td>
        <td>是否售罄</td>
        <td>商品总数</td>
        {*<td>规格</td>*}
        {*<td>限购数量</td>*}
        <td>排序</td>
        <td>推荐度</td>
        <td>状态</td>
        <td>操作</td>
    </tr>
    {foreach from=$data item=item}
        <tr>
            <td>{$item.auto_id}</td>
            <td>{$item.title}</td>
            <td>
                {foreach $goodsectionList as $key => $value}
                    {if $value['id'] eq $item.goodsection}{$value['name']}{/if}
                {/foreach}
            </td>
            <td>
                {if $item.img2 neq ''}<img style="width: 80px;height: 80px;" src="{$img_oss}/uploads/{$item.img2}">{/if}
            </td>
            <td>
                {if $item.img3 neq ''}<img style="width: 80px;height: 80px;" src="{$img_oss}/uploads/{$item.img3}">{/if}
            </td>

            <td>{$item.price_new}</td>
            <td>{$item.purchase_price}</td>
            <td>{$item.freight}</td>
            <td>{$item.cs_num}</td>
            <td>{$item.paynum}</td>
            <td>
                {if $item.is_banner eq 1}是{/if}
                {if $item.is_banner eq 2}否{/if}
            </td>
            <td>
                {if $item.is_soldout eq 1}是{/if}
                {if $item.is_soldout eq 2}否{/if}
            </td>
            <td>{$item.num}</td>
            {*<td>{$item.specification}</td>*}
            {*<td>{$item.is_purchasing}</td>*}
            <td>{$item.paixu}</td>
            <td>{$item.re_degree}星</td>



            {*<td>{$item.pro}--{$item.cit}{$item.address}</td>*}
            <td>
                <span style="color: #4cae4c">{if $item.status eq 1}正常{/if}</span>
                <span style="color: #ff3b36">{if $item.status eq 5}下架{/if}</span>
                <span style="color: #ff3b36">{if $item.status eq 2}删除{/if}</span>
            </td>
            <td>
                {*<a href="/adminmall/Goods/productList?gid={$item.auto_id}" >查看子商品</a>*}
                <a href="/adminmall/Goods/save?id={$item.auto_id}" >修改</a>
                <a onclick="return confirm('确定要删除此商品吗？');" href="/Goods/del?id={$item.auto_id}&status=3"   >删除</a>
                <a href="/adminmall/Goods/goodsUrl?id={$item.auto_id}" rel="ajax">商品链接</a>
                <a href="/adminmall/Goods/goodsCategoryModify?id={$item.auto_id}" rel="ajax">修改分类</a>
            </td>
        </tr>
    {/foreach}
</table>
{include "pager.tpl"}
<script type="text/javascript">
    $(function () {
        create_date_picker();
    });

    function dao(){
        var nickname = $('#nickname').val();
        var mobile = $('#mobile').val();
        var begin_date = $('#begin_date').val();
        var end_date = $('#end_date').val();
        var intentionE1=$("#intention option:selected");
        var intention = intentionE1.val();
//        alert(intention);
//        alert(nickname);
//        alert(mobile);
//        alert(end_date);

        location.href = "/admin/Order/excelDao?begin_date=" + begin_date + "&end_date=" + end_date+ "&nickname=" + nickname+ "&mobile=" + mobile + "&intention=" + intention;

    }
</script>
{include 'footer.tpl'}